import VueRouter from 'vue-router'
import Vue from 'Vue'
import Layout from '@/views/layout/Layout.vue'

Vue.use(VueRouter)
export const routerMap = [
    {
        path: '/dashboard',
        component: Layout,
        redirect: '/dashboard/index',
        children: [{
            path: 'index',
            component: require('@/views/dashboards/index.vue').default,
            name: 'dashboard',
            meta: { title: 'dashboard' }
        }]
    },
    {
        path: '',
        component: Layout,
        redirect: 'documentation',
        children: [{
            path: 'documentation',
            component: require('@/views/documentation/index.vue').default,
            name: 'documentation',
            meta: { title: 'documentation' }
        }]
    },

    {
        path: '/icon',
        component: Layout,
        children: [{
            path: 'index',
            component: require('@/views/svg-icons/index.vue').default,
            name: 'icons',
            meta: { title: 'icons' }
        }]
    },
    {
        path: '/zip',
        component: Layout,
        redirect: '/zip/download',
        alwaysShow: true,
        meta: { title: 'zip' },
        children: [{ path: 'download', component: require('@/views/zip/index.vue').default, name: 'exportZip', meta: { title: 'exportZip' } }]
    },
    {
        path: '/charts',
        component: Layout,
        redirect: 'noredirect',
        name: 'charts',
        meta: {
            title: 'charts'
        },
        children: [
            { path: 'keyboard', component: require('@/views/charts/keyboard.vue').default, name: 'keyboardChart', meta: { title: 'keyboardChart' } },
            { path: 'line', component: require('@/views/charts/line.vue').default, name: 'lineChart', meta: { title: 'lineChart' } },
            { path: 'mixchart', component: require('@/views/charts/mixchart.vue').default, name: 'mixchart', meta: { title: 'mixchart' } },
        ]
    },
    {
        path: '/example',
        component: Layout,
        redirect: '/example/table/complex-table',
        name: 'example',
        meta: {
            title: 'example'
        },
        children: [
            {
                path: '/example/table',
                component: require('@/views/example/table/index.vue').default,
                redirect: '/example/table/complex-table',
                name: 'Table',
                meta: {
                    title: 'Table',
                },
                children: [
                    { path: 'inline-edit-table', component: require('@/views/example/table/inlineEditTable.vue').default, name: 'inlineEditTable', meta: { title: 'inlineEditTable' } },
                    { path: 'drag-table', component: require('@/views/example/table/dragTable.vue').default, name: 'dragTable', meta: { title: 'dragTable' } },
                    { path: 'complex-table', component: require('@/views/example/table/complexTable.vue').default, name: 'complexTable', meta: { title: 'complexTable' } }
                ]
            },
            { path: 'tab/index', component: require('@/views/example/tab/index.vue').default, name: 'tab', meta: { title: 'tab' } }
        ]
    }
]

export default new VueRouter({
    routes: routerMap
})